import os

# This trigger is meant to disallow filenames that may cause problems with
# unix and windows filesystems, independently from what svn may or may not
# disallow itself)

# Disallow all kinds of whitespace (space, tab, nl)
BADCHARS_WS=" \t\n"
# These make windows unhappy
BADCHARS_OTHER='*?\\:;'
BADCHARS = BADCHARS_WS + BADCHARS_OTHER

def RunHook(hi, logger):

  for path in hi.paths_changed:
    for char in BADCHARS:
      #print "looking for %s in %s" % (char, path)
      if char in path:
	logger.warning("'%s' is forbidden in pathname '%s'" % (char, path))
	return 255

  return 0
